package com.youwu.weather.service;

import com.youwu.weather.vo.City;
import com.youwu.weather.vo.WeatherResponse;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * 此类是熔断机制时的回调类
 */
@Component
public class DataClientFallback implements DataClient {
    @Override
    public List<City> listCity() {
        List<City> cityList = new ArrayList<>();
        // 提供默认城市
        City city = new City();
        city.setCityId("10001");
        city.setCityCn("北京");
        city.setCityEn("beijing");
        cityList.add(city);
        return null;
    }

    @Override
    public WeatherResponse getCurrentWeather(String city) {
        return null;
    }

    @Override
    public WeatherResponse getHourlyWeather(String city) {
        return null;
    }

    @Override
    public WeatherResponse getForecastWeather(String city) {
        return null;
    }

    @Override
    public WeatherResponse getLifestyleWeather(String city) {
        return null;
    }
}
